package cn.wolfcode.p2p.bussness.service.impl;

import cn.wolfcode.p2p.bussness.domain.PaymentScheduleDetail;
import cn.wolfcode.p2p.bussness.mapper.PaymentScheduleDetailMapper;
import cn.wolfcode.p2p.bussness.service.IPaymentScheduleDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class PaymentScheduleDetailServiceImpl implements IPaymentScheduleDetailService {
	@Autowired
	private PaymentScheduleDetailMapper paymentScheduleDetailMapper;
	@Override
	public int save(PaymentScheduleDetail paymentScheduleDetail) {
		return paymentScheduleDetailMapper.insert(paymentScheduleDetail);
	}

	@Override
	public int update(PaymentScheduleDetail paymentScheduleDetail) {
		return paymentScheduleDetailMapper.updateByPrimaryKey(paymentScheduleDetail);
	}

	@Override
	public PaymentScheduleDetail get(Long id) {
		return paymentScheduleDetailMapper.selectByPrimaryKey(id);
	}

	@Override
	public void updatePayDate(Long psId, Date payDate) {
		paymentScheduleDetailMapper.updatePayDate(psId,payDate);
	}
}
